<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="layout/layout">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>列表</title>
    <link type="text/css" href="https://mazey.cn/cdn/bootstrap-3.4.1/css/bootstrap.min.css" rel="stylesheet" />
</head>

<body>
<div class="wrapper">
    <div class="main">
        <div class="container">
           <h1>博客列表</h1>
            <form action="/blog/blogList" type="POST" id="blackTraderForm">
            </form>
            <div>
                <table class="table">
                    <thead>
                    <tr>
                        <th>标题</th>
                        <th>内容</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="item:${blogDTOList}">
                        <input type="hidden" th:value="${item.blogId}">
                        <td th:text="${item.blogTitle}"></td>
                        <td th:text="${item.blogContent}"></td>
                        <td class="item-model" style="margin-left:130px;padding-left: 120px">
                        <span><a href="JavaScript:void(0)"
                              th:href="@{/blog/blogDetail(blogid=${item.blogId})}">详情</a></span>
                     <span><a href="JavaScript:void(0)"
                              th:href="@{/blog/toEditBlog(blogid=${item.blogId})}">编辑</a></span>
                            <span><a href="JavaScript:void(0)"
                               th:href="@{/blog/deleteBlog(blogid=${item.blogId})}">删除</a></span>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <!-- bootstrap的弹窗 -->
            <div class="modal fade" id="dialogDelete" tabindex="-1" role="dialog" aria-labelledby="lv1Title" aria-hidden="true">
                <div class="modal-dialog modal-dialog-centered" role="document" style="width: 350px;">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="modal-title">操作确认</h5>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">×</span>
                            </button>
                        </div>
                        <div class="modal-body">
                            <div class="modal-tip-cnt cnt-tip">
                                <span>您确定要删除该条信息吗？</span>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                            <button type="button" class="btn btn-primary J-delete-confirm">确认</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>